package com.yequan.thread.base.volatilepackage;

public class VolatileFeatureClass2 {

    private long v = 0L;

    public synchronized void set(long l) {
        v = l;
    }

    public void getAndIncrement() {
        long temp = get();
        temp += 1L;
        set(temp);
    }

    public synchronized long get() {
        return v;
    }

}
